package com.ioc.common.enums;

/**
 * payment 服务状态设计
 *
 * @author ONEC
 */
public enum ChangeStatusEnum {

    /**
     * 申请状态未处理(订单)
     */
    SUCCESS(0, "成功"),
    /**
     * 申请状态处理中
     */
    CARD_FAILED(1, "结算卡变更失败"),
    /**
     * 申请状态失败
     */
    RATE_FAILED(2, "费率变更失败"),
    /**
     * 申请状态成功
     */
    AVAILABLE(3, "可用");

    private int index;

    private String msg;

    ChangeStatusEnum(int index, String msg) {
        this.index = index;
        this.msg = msg;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * 验证成功：
     *
     * @param status
     * @return
     */
    public static boolean isSuccess(ChangeStatusEnum status) {
        return SUCCESS.equals(status);
    }

    /**
     * 验证可用：
     *
     * @param status
     * @return
     */
    public static boolean isAvailable(ChangeStatusEnum status) {
        return AVAILABLE.equals(status);
    }

}
